str1 = "IPrlovePythons"
str2 = "Python"

def isSubstring(str1,str2):
    Flag = True
    dis=0
    ind = 0
    strLength = len(str2)
    for i in range(0,len(str2)):
      ind_next = str1.find(str2[i],ind)
      if Flag: # firt time in the loop
        ind = ind_next
        Flag = False
      elif (ind_next - ind) == 1:
        ind = ind_next
        dis = dis +1
        if dis == strLength-1:
          print('Find the str2 in str1, start position at {}'.format(ind_next-dis))
          break
      else:
         if i == (strLength - 1):
            print('not find str2 in str1')
         dis = 1
         ind = ind_next
if __name__ == '__main__':
    isSubstring(str1,str2)